<link type="text/css" rel="stylesheet" href="<?php echo url('/assets/css/chat_index.css?').time(); ?>"/>
<div class="info">
    <img src="<?php echo url('/assets/img/ajax-loader.gif'); ?>" alt="loading..." class="ajax-loader"/>
    <span class="tick"></span>
	<span class="name"><?php echo $user['nick'];?></span>
</div>

<div class="chat-content-wrap">
    <ul class="chat-content">
	<li></li>
    </ul>
</div>

<form action="<?php echo url('chat/send'); ?>" method="post">
	<?php if((int)$_SESSION['reading_user_id'] == 1):?>
	<select name="to">
		<?php foreach($users as $item):?>
			<?php if($item['id'] != 1):?>
				<option value="<?php echo $item['id'];?>"><?php echo $item['name'].'/'.$item['nick'];?></option>
			<?php endif;?>
		<?php endforeach;?>
	</select>
	<?php endif;?>
    <input type="text" name="content" class="content"/>
    <input type="submit" name="submit" value="send"/>
</form>

<div class="buttons">
    <!--<a href="javascript:void(0);" class="clear">清屏</a>-->
    <a href="javascript:void(0);" class="open-history">打开聊天记录</a>
    <a href="javascript:void(0);" class="close-history">关闭聊天记录</a>
    <a href="javascript:void(0);" class="stop-auto-receive">停止自动加载数据</a>
    <a href="javascript:void(0);" class="start-auto-receive">开启自动加载数据</a>
    <a href="javascript:void(0);" class="receive">手工加载数据</a>
</div>

<table class="chat-history">
    <thead>
	<tr>
	    <td>Name</td>
	    <td>IP</td>
	    <td>Content</td>
	    <td>Created At</td>
	</tr>
    </thead>
    <tfoot>
	<tr><td colspan="4"></td></tr>
    </tfoot>
    <tbody>
	<tr><td colspan="4" style="text-align: center;">Loading...</td></tr>
    </tbody>
</table>

<script type="text/javascript" src="<?php echo url('/assets/js/chat_index.js?').time(); ?>" charset="utf-8"></script>